//处理数据的路由
const router = require('koa-simple-router');
const model = require('../models');

let controller = (app) => {
    app.use(router(_ => {
        _.get('/', (ctx, next) => {
          ctx.render('view')
        })
    
        //get art-template
        _.get('/index1', async (ctx, next) => {
            let data = model.db()
            
            ctx.render('index1',{data})
        })

        _.get('/index2', async (ctx, next) => {
            let data = model.db()
            
            ctx.render('index2',{data})
        })
    }))
}


module.exports = controller